home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 835 b | 42 lines | [TEXT/ttxt] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 1, example 2
-
- --create a module to avoid name conflicts
- module Scratch0 uses ScriptX end
- in module Scratch0
-
- class Dog ()
- instance variables
- name, owner, breed, age, length, weight, sex, temperament
- instance methods
- method bark self -> print "makes a lot of noise"
- method fetch self -> print "fetches a stick"
- method sniff self -> print "sticks nose into things"
- end
-
- class HuntingHound (Dog)
- instance methods
- method bark self -> print "wooof, wooof"
- end
-
- class LapDog (Dog)
- instance methods
- method bark self -> print "yip, yip, yip, yip, yip"
- end
-
- class Shihtzu (LapDog)
- instance methods
- method bark self -> (
- nextMethod self
- print "jumps up and down"
- )
- end
-
- object tyler (Shihtzu)
- settings name:"Tyler"
- end
-
- bark tyler
- -->>>